package com.wanxi.controller;

import com.wanxi.dto.ProductDTO;
import com.wanxi.dto.ProductInstanceDTO;
import com.wanxi.result.CommonResult;
import com.wanxi.service.FrontDoctorService;
import com.wanxi.vo.*;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(description = "医生相关接口")
@RestController
@RequestMapping("/front/doctor")
public class FrontDoctorController {

    @Autowired
    private FrontDoctorService  frontDoctorService;

    @ApiOperation(value = "查询医生")
    @ApiResponses({
            @ApiResponse(code = 200,message = "OK",responseContainer = "List",response = DoctorDTO.class)
    })
    @GetMapping("/findDoctor")
    public CommonResult findDoctor(DoctorQuery doctorQuery){
        return frontDoctorService.findDoctor(doctorQuery);
    }

    @ApiOperation(value = "查询医生详情")
    @ApiResponses({
            @ApiResponse(code = 200,message = "OK",responseContainer = "List",response = DoctorDTO.class)
    })
    @GetMapping("/findDoctorDetail")
    public CommonResult findDoctorDetail(Long doctorId){
        return frontDoctorService.findDoctorDetail(doctorId);
    }

    @ApiOperation(value = "查询医生支持的服务包类型")
    @ApiImplicitParam(name = "doctorId",value = "医生id",required = true)
    @ApiResponses({
            @ApiResponse(code = 200,message = "OK",response = ProductDTO.class,responseContainer = "List")
    })
    @GetMapping("/findProductByDoctorId")
    public CommonResult findProductByDoctorId(Long doctorId){
        return frontDoctorService.findProductByDoctorId(doctorId);
    }

    @ApiOperation(value = "查询医生进行的服务包实体")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "doctorId",value = "医生id",required = true),
            @ApiImplicitParam(name = "serviceStatus",value = "服务包实体状态",required = true)
    })
    @ApiResponses({
            @ApiResponse(code = 200,message = "OK",response = ProductInstanceDTO.class,responseContainer = "List")
    })
    @GetMapping("/findProductEntityByDoctorId")
    public CommonResult findProductEntityByDoctorId(Long doctorId,Integer serviceStatus){
        return frontDoctorService.findProductEntityByDoctorId(doctorId,serviceStatus);
    }

    @ApiOperation(value = "查询医生治疗的患者")
    @ApiImplicitParam(name = "doctorId",value = "医生id",required = true)
    @ApiResponses({
            @ApiResponse(code = 200,message = "OK",response = PatientVO.class,responseContainer = "List")
    })
    @GetMapping("/findPatientByDoctorId")
    public CommonResult findPatientByDoctorId(Long doctorId) {
        return frontDoctorService.findPatientByDoctorId(doctorId);
    }

}
